package com.eight.cloud.core.utils.validation.annotation;


import com.eight.cloud.core.utils.validation.validator.PhoneNumberValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * 身份证号码校验
 *
 * @InterfaceName: IsIdCard
 * @Author: TXC
 * @Date: 2024-10-29 14:45
 **/
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER })
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy = {PhoneNumberValidator.class })
public @interface IsIdCard {
    // 是否需要
    boolean required() default true;
    // 信息
    String message() default "手机号码格式错误";

    Class<?>[] groups() default { };

    Class<? extends Payload>[] payload() default { };
}
